package com.itheima.day05.instant;

import java.time.Instant;

public class Test {
    public static void main(String[] args) {
      //获取当前时间
        Instant now = Instant.now();
        //获取总秒数
        long totalSeconds = now.getEpochSecond();
        System.out.println(totalSeconds);
        //获取毫秒数
        long totalMillis = now.toEpochMilli();
        System.out.println(totalMillis);
        //加、减、判断 时间（无侵入）
        Instant add = now.plusSeconds(1000);
        System.out.println(add.getEpochSecond());
    }
}
